This invention relates to computer systems for displaying graphical objects.
Graphical computer display systems typically create images on a display device (e.g., a CRT or other display screen) by building the images as a mosaic of simple graphical objects such as rectangles, circles, and triangles. Portions of the image that become obscured, for example, by a dialog box, pull-down menu, or other item must be redrawn on the screen when the obscuring item is removed. In some systems, this is done through the use of so-called backing store, in which pixels that are obscured are temporarily saved and are redrawn on the display when the obscuring item is removed. Backing store is of little use, however, when the objects change position or display characteristics dynamically, because the saved pixel values may have become obsolete by the time that the obscuring item is removed.
One technique for determining which objects to redraw is to detect which objects intersect the obscuring item, and redraw only those objects. This is typically done by passing to all objects in the image a set of coordinates that define a rectangle that encloses the obscuring item. Each object determines whether it is located within this rectangle by intersecting its bounding rectangle (i.e., a polygon that encloses the object) with the rectangle of the obscuring item. Objects finding themselves within any portion of the obscuring rectangle of the item are redrawn.
The intersection procedure is generally performed by determining the locations of the edges (left, right, top, and bottom) of the object's rectangle, and comparing them with the positions of the corresponding edges of the obscuring rectangle. The relative positions of the edges determine whether the object is within the obscuring rectangle. Generally, 6-8 edge comparisons are needed to make this determination.